import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/merchanthome',
      name: 'merchanthome',
      component: () => import('../views/MerchantHome.vue'),
      children:[
        {
          //参数待传
          path:'/merchanthome/merchantmenu/:id',
          name: 'merchantmenu',
          component: () => import('../components/merchant/MerchantMenu.vue')
        },
        {
          path:'/merchanthome/merchantindex',
          name: 'merchantindex',
          component: () => import('../components/merchant/MerchantIndex.vue')
        },
        {
          path:'/merchanthome/merchantrecommend',
          name: 'merchantrecommend',
          component: () => import('../components/merchant/MerchantRecommend.vue')
        }
      ]
    }
    ,
    {
      path: '/myorder',
      name: 'myorder',
      component: () => import('../views/MyOrder.vue')
    }
    ,
    {
      path: '/paySuccess',
      name: 'paySuccess',
      component: () => import('../views/pay/Success.vue')
    }
    ,
    {
      path:'/MapContainer',
      name: 'MapContainer',
      component: () => import('../components/MapContainer.vue')
    },
    {
      path: '/welcome',
      name:'welcome',
      component:()=>import('../views/welcome.vue')
    },
    {
      path:'/basicmessage',
      name:'basicmessage',
      component:()=>import('../views/profilechild/BasicMessage.vue')
    },
    {
      path:'/changemessage',
      name:'changemessage',
      component:()=>import('../views/profilechild/ChangeMessage.vue')
    },
    {
      path:'/useraddress',
      name:'useraddress',
      component:()=>import('../views/profilechild/UserAddress.vue')
    },
    {
      path: '/home',
      name:'home',
      component:()=>import('../views/home.vue')
    },
    {
      path: '/login',
      name:'login',
      component:()=>import('../views/login.vue')
    },
    {
      path: '/allOrder',
      name:'allOrder',
      component:()=>import('../views/Order.vue')
    },
    {
      path: '/waitPay',
      name:'waitPay',
      component:()=>import('../views/waitPay.vue')
    },
    {
      path: '/waitRemark',
      name:'waitRemark',
      component:()=>import('../views/waitRemark.vue')
    },
    {
      path: '/afterPay',
      name:'afterPay',
      component:()=>import('../views/afterPay.vue')
    },
    {
      path: '/collectShop',
      name:'collectShop',
      component:()=>import('../views/collectShop.vue')
    },
    {
      path: '/collectDish',
      name:'collectDish',
      component:()=>import('../views/collectDish.vue')
    },
    {
      path: '/waitArrive',
      name:'waitArrive',
      component:()=>import('../views/waitArrive.vue')
    },
    {
      path: '/register',
      name:'register',
      component:()=>import('../views/register.vue')
    },
    {
      path: '/userregister',
      name:'userregister',
      component:()=>import('../views/UserRegister.vue')
    },
    {
      path: '/searchSweet',
      name:'searchSweet',
      component:()=>import('../views/searchSweet.vue')
    },
    {
      path: '/searchDrink',
      name:'searchDrink',
      component:()=>import('../views/searchDrink.vue')
    },
    {
      path: '/searchSnack',
      name:'searchSnack',
      component:()=>import('../views/searchSnack.vue')
    },
    {
      path: '/searchBreakfast',
      name:'searchBreakfast',
      component:()=>import('../views/searchBreakfast.vue')
    },
    {
      path: '/searchFruit',
      name:'searchFruit',
      component:()=>import('../views/searchFruit.vue')
    },
    {
      path: '/searchMeat',
      name:'searchMeat',
      component:()=>import('../views/searchMeat.vue')
    },
    {
      path: '/searchFastfood',
      name:'searchFastfood',
      component:()=>import('../views/searchFastfood.vue')
    },
    {
      path: '/searchHomecook',
      name:'searchHomecook',
      component:()=>import('../views/searchHomecook.vue')
    },
    {
      path: '/searchresult/:content',
      name:'searchresult',
      component:()=>import('@/views/searchresult.vue')
    },
    {
      path: '/waitcomplete',
      name:'waitcomplete',
      component:()=>import('@/views/waitcomplete.vue')
    }
    ,
    {
      path: '/test',
      name:'test',
      component:()=>import('@/views/test.vue')
    }
    ,
    {
      path: '/resetpassword',
      name:'resetpassword',
      component:()=>import('@/views/resetPassword.vue')
    }
  ]
})

export default router
